<jsp:useBean id="userInfoMap" scope="request" class="java.util.HashMap"/>

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
    <meta name="description" content="" />
    <meta name="author" content="" />
    <title>后台</title>
    <link href="${pageContext.request.contextPath}/admin/css/glyphicon.css" rel="stylesheet" />
    <link href="${pageContext.request.contextPath}/admin/css/styles.css" rel="stylesheet" />
    <script src="${pageContext.request.contextPath}/admin/js/all.js"></script>
</head>
<body class="sb-nav-fixed">
<%@ include file="include/head.jsp" %>
<div id="layoutSidenav">
    <%@ include file="include/nav.jsp" %>
    <div id="layoutSidenav_content">
        <div class="container-fluid px-4">
            <div class="card mb-4">
                <div class="card-header">
                    <i class="fas fa-table me-1"></i>
                    表格
                </div>
                <div class="card-body">
                    <br>
                    <table id="datatablesSimple" >
                        <thead>
                        <tr>
                            <th>学号</th>
                            <th>姓名</th>
                            <th>职位</th>
                            <th>管理员等级</th>
                            <th>更改管理员信息</th>
                        </tr>
                        </thead>
                        <tbody>


                        <c:forEach items="${userInfo}" var="user">
                            <tr>
                                <td>${user.userID}</td> <!-- 展示HashMap的key，假设它是用户ID -->
                                <td>${user.name}</td>
                                <td>${user.role}</td>
                                <td>${user.adminName}</td>
                                <td>
                                    <a href="${pageContext.request.contextPath}/EditAdminServlet?id=${user.userID}" methods="get">
                                        <button type="button" class="btn btn-default">
                                            <i class="glyphicon glyphicon-pencil"></i>修改
                                        </button>
                                    </a>
                                </td>
                            </tr>
                        </c:forEach>



                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <%@ include file="include/foot.jsp" %>
    </div>
</div>
<script src="${pageContext.request.contextPath}/admin/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/admin/js/scripts.js"></script>
<script src="${pageContext.request.contextPath}/admin/js/simple-datatables@latest.js"></script>
<script src="${pageContext.request.contextPath}/admin/js/datatables-simple-demo.js"></script>
</body>
</html>